package com.seven.good.service.impl;

import com.seven.good.dao.GoodPicturesMapper;
import com.seven.good.exception.ServiceException;
import com.seven.good.pojo.GoodPictures;
import com.seven.good.service.GoodPicturesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <h3>easyauction</h3>
 *
 * @author : 王胜奔
 * @description : GoodPicturesService接口的实现类
 * @date : 2019-10-19 00:07
 **/
@Service
public class GoodPicturesServiceImpl implements GoodPicturesService {
    @Autowired
    private GoodPicturesMapper goodPicturesMapper;
    @Override
    public List<GoodPictures> selectPics(Integer gid) {
        return goodPicturesMapper.selectPics(gid);
    }

    @Override
    public void insertPicture(GoodPictures goodPictures) {
        try {
            goodPicturesMapper.insertSelective(goodPictures);
        } catch (Exception e) {
            e.printStackTrace();
            throw new ServiceException("图片信息插入异常");
        }
    }
}
